import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/login",
    component: () => import("../pages/login/LoginIndex.vue"),
  },
  {
    path: "/home",
    component: () => import("../pages/home/HomeIndex.vue"),
    children: [
      {
        path: "/home",
        redirect: "/home/index",
      },
      {
        path: "index",
        component: () => import("../pages/home/index/IndexView.vue"),
      },
      {
        path: "classify",
        component: () => import("../pages/home/classify/ClassifyView.vue"),
      },
      {
        path: "cart",
        component: () => import("../pages/home/cart/CartView.vue"),
      },
      {
        path: "mine",
        component: () => import("../pages/home/mine/MineView.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
